<html>
<head><meta charset="utf-8"><title>Why is rustc_codegen_ssa not simply called rustc_codegen? · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F.html">Why is rustc_codegen_ssa not simply called rustc_codegen?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="196336347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Why%20is%20rustc_codegen_ssa%20not%20simply%20called%20rustc_codegen%3F/near/196336347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F.html#196336347">(May 05 2020 at 17:04)</a>:</h4>
<p>I wonder if there's some rationale behind this name :)</p>



<a name="196336807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Why%20is%20rustc_codegen_ssa%20not%20simply%20called%20rustc_codegen%3F/near/196336807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F.html#196336807">(May 05 2020 at 17:08)</a>:</h4>
<p>You should probably ask <span class="user-mention" data-user-id="119009">@eddyb</span>.</p>



<a name="196901115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Why%20is%20rustc_codegen_ssa%20not%20simply%20called%20rustc_codegen%3F/near/196901115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F.html#196901115">(May 08 2020 at 14:21)</a>:</h4>
<p><span class="user-mention" data-user-id="116458">@Charles Lew</span> yes, although we haven't done much organizing since. the idea is that the common denominator (between, say, LLVM and Cranelift) is SSA (more accurately, CFG+SSA)</p>



<a name="196901219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Why%20is%20rustc_codegen_ssa%20not%20simply%20called%20rustc_codegen%3F/near/196901219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F.html#196901219">(May 08 2020 at 14:22)</a>:</h4>
<p>a lot of the stuff  that's in <code>rustc_codegen_ssa</code> should probably be in separate crates but what's in the <code>mir</code> module in there, coupled with the "builder" APIs, is suited to a particular kind of IR</p>



<a name="196901344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Why%20is%20rustc_codegen_ssa%20not%20simply%20called%20rustc_codegen%3F/near/196901344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F.html#196901344">(May 08 2020 at 14:23)</a>:</h4>
<p>but maybe we should just have a different architecture that makes this less relevant, idk</p>



<a name="196901507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Why%20is%20rustc_codegen_ssa%20not%20simply%20called%20rustc_codegen%3F/near/196901507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F.html#196901507">(May 08 2020 at 14:24)</a>:</h4>
<p>Thanks for the explanation! Do we have vision for codegen infrastructure of non-SSA?</p>



<a name="196901515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Why%20is%20rustc_codegen_ssa%20not%20simply%20called%20rustc_codegen%3F/near/196901515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F.html#196901515">(May 08 2020 at 14:24)</a>:</h4>
<p>an example of something that wouldn't fit well: WASM, because it's not really SSA, and unlike LLVM IR or Cranelift, has mutable local variables that don't require memory accesses</p>



<a name="196901600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Why%20is%20rustc_codegen_ssa%20not%20simply%20called%20rustc_codegen%3F/near/196901600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F.html#196901600">(May 08 2020 at 14:25)</a>:</h4>
<p>i see, thanks</p>



<a name="196901603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Why%20is%20rustc_codegen_ssa%20not%20simply%20called%20rustc_codegen%3F/near/196901603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F.html#196901603">(May 08 2020 at 14:25)</a>:</h4>
<p>(so you'd want to use that instead of naively relying on the emulated stack)</p>



<a name="196901621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Why%20is%20rustc_codegen_ssa%20not%20simply%20called%20rustc_codegen%3F/near/196901621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F.html#196901621">(May 08 2020 at 14:25)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116458">Charles Lew</span> <a href="#narrow/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F/near/196901507" title="#narrow/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F/near/196901507">said</a>:</p>
<blockquote>
<p>Thanks for the explanation! Do we have vision for codegen infrastructure of non-SSA?</p>
</blockquote>
<p>very long-term, probably VSDG</p>



<a name="196901708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Why%20is%20rustc_codegen_ssa%20not%20simply%20called%20rustc_codegen%3F/near/196901708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F.html#196901708">(May 08 2020 at 14:26)</a>:</h4>
<p>though some people would probably protest doing anything other than having a CFG+SSA intermediary IR</p>



<a name="196901761"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Why%20is%20rustc_codegen_ssa%20not%20simply%20called%20rustc_codegen%3F/near/196901761" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F.html#196901761">(May 08 2020 at 14:26)</a>:</h4>
<p>Really never heard this abbr before, i'll google it and learn :)</p>



<a name="196901797"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Why%20is%20rustc_codegen_ssa%20not%20simply%20called%20rustc_codegen%3F/near/196901797" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F.html#196901797">(May 08 2020 at 14:26)</a>:</h4>
<p>I wonder if I have the links handy</p>



<a name="196901910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Why%20is%20rustc_codegen_ssa%20not%20simply%20called%20rustc_codegen%3F/near/196901910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F.html#196901910">(May 08 2020 at 14:28)</a>:</h4>
<p>(Look for "Value State Dependence Graph")</p>



<a name="196901961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Why%20is%20rustc_codegen_ssa%20not%20simply%20called%20rustc_codegen%3F/near/196901961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F.html#196901961">(May 08 2020 at 14:28)</a>:</h4>
<p>idk why I can never find this w/o expanding the acronym <a href="http://sro.sussex.ac.uk/id/eprint/7576/" title="http://sro.sussex.ac.uk/id/eprint/7576/">http://sro.sussex.ac.uk/id/eprint/7576/</a></p>



<a name="196901962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Why%20is%20rustc_codegen_ssa%20not%20simply%20called%20rustc_codegen%3F/near/196901962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F.html#196901962">(May 08 2020 at 14:28)</a>:</h4>
<p><a href="https://www.researchgate.net/publication/340038531_RVSDG_An_Intermediate_Representation_for_Optimizing_Compilers" title="https://www.researchgate.net/publication/340038531_RVSDG_An_Intermediate_Representation_for_Optimizing_Compilers">https://www.researchgate.net/publication/340038531_RVSDG_An_Intermediate_Representation_for_Optimizing_Compilers</a><br>
Searched and find one</p>



<a name="196901990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Why%20is%20rustc_codegen_ssa%20not%20simply%20called%20rustc_codegen%3F/near/196901990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F.html#196901990">(May 08 2020 at 14:28)</a>:</h4>
<p>RVSDG is a variant of VSDG FWIW</p>



<a name="196902035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Why%20is%20rustc_codegen_ssa%20not%20simply%20called%20rustc_codegen%3F/near/196902035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F.html#196902035">(May 08 2020 at 14:28)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> I keep googling "stanier VSDG" and there are no good results but expanding it does give the correct (<a href="http://sro.sussex.ac.uk/id/eprint/7576/" title="http://sro.sussex.ac.uk/id/eprint/7576/">http://sro.sussex.ac.uk/id/eprint/7576/</a>) one :/</p>



<a name="196902038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Why%20is%20rustc_codegen_ssa%20not%20simply%20called%20rustc_codegen%3F/near/196902038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F.html#196902038">(May 08 2020 at 14:28)</a>:</h4>
<p>idk why that is</p>



<a name="196902087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Why%20is%20rustc_codegen_ssa%20not%20simply%20called%20rustc_codegen%3F/near/196902087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F.html#196902087">(May 08 2020 at 14:29)</a>:</h4>
<p><span class="user-mention" data-user-id="116458">@Charles Lew</span> anyway this is one of the big papers on it <a href="http://sro.sussex.ac.uk/id/eprint/7576/1/Stanier%2C_James.pdf" title="http://sro.sussex.ac.uk/id/eprint/7576/1/Stanier%2C_James.pdf">http://sro.sussex.ac.uk/id/eprint/7576/1/Stanier%2C_James.pdf</a></p>



<a name="196902119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Why%20is%20rustc_codegen_ssa%20not%20simply%20called%20rustc_codegen%3F/near/196902119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F.html#196902119">(May 08 2020 at 14:30)</a>:</h4>
<p>chapter 2 is a good overview</p>



<a name="196902185"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Why%20is%20rustc_codegen_ssa%20not%20simply%20called%20rustc_codegen%3F/near/196902185" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F.html#196902185">(May 08 2020 at 14:30)</a>:</h4>
<p>it's also published independently as <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.885.5223&amp;rep=rep1&amp;type=pdf" title="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.885.5223&amp;rep=rep1&amp;type=pdf">http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.885.5223&amp;rep=rep1&amp;type=pdf</a></p>



<a name="196902286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Why%20is%20rustc_codegen_ssa%20not%20simply%20called%20rustc_codegen%3F/near/196902286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Why.20is.20rustc_codegen_ssa.20not.20simply.20called.20rustc_codegen.3F.html#196902286">(May 08 2020 at 14:31)</a>:</h4>
<p>Thanks!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>